some code cleanup to make the debugging easier