cleaning up code and messages