JARVIS-338 refactoring and linting