add lint rules, refactoring