Cleaning up code a bit more