refactored code, linting