Cleaning up code and messages