refactored to meet the UnitTest