Cleaned up code and linting errors