karma coverage refactoring