Clean up the code a litle