Began cleaning up code