code quality improvements