linting and code cleanup