Code cleanup and linting