Enhance coverage
Refactoring, code cleanup and formating