Debugging clean up and a few things for later use