converting to use interface, to allow for mocking in unit tests