Remove debug mode
Some code and style cleanups