Cleanup a little bit of the code