fixed t. issue in test
passing tests with refactored code