added some helper functions to stay dry