some basic clean up of the code