add coverage to ignore and som refactoring
merging test cases
refactoring the code for good practice