refactored feature and unit tests