add precommit-hook, clean code to pass linting