code cleanup + linter fixes