code refactoring and coverage changes