Partitioning out the debug code from the main code to avoid a future mess