First bit of refactor to clean up public API