Cleaning up a bit of code