tidy this up a bit
clean up this one too for the API