Begun refactoring