Cleaning up my code a bit