# THIS CODE IS WAAAY MORE COMPLEX THAN IT NEEDS TO BE. It's the
# result of a massive refactoring exercise that concentrated all
# the old nastiness in one spot. It hasn't been finally simplified
# THIS CODE IS WAAAY MORE COMPLEX THAN IT NEEDS TO BE. It's the
# result of a massive refactoring exercise that concentrated all
# the old nastiness in one spot. It hasn't been finally simplified