Cleanup code and comments