code refactoring + lint errors fixed