cleaning up the code