hoist this function... you don't need to recreate it each time