Cleaning up code and comments