code refactoring & improving UT coverage