refactoring, added tests, extracted hyper-config