Started to clean up code