refactoring code, making things simpler