added tests and a parameterless constructor to support mocking