added classes, methods, and refactored