Improved code coverage using refactoring and removing unused code