cleaning up code and removing unused stuff