code refactoring to make it more modulable
update unit test