Changed plain helper functions to functors