move test to test folder...
more refactor to make code more testable