refactored for testins