some comments on those helper functions might be nice