refactored tests, tests passing