refactored some method names and cleaned up other code