Improvements to code quality