added tests and helper methods