Improve code quality and coverage