code cleanup
test code coverage improved