Rearranged debugging print functions and helpers