Small refactoring to tidy up the API now all tests are passing