Making it pretty and cleaning up the code