re-factor for code coverage

Instructions: 99% Branches: 100%