Improve code quality; untested