moved (most) helpers into their own file