added tests and test helpers