Moved around methods and cleaned up code.