Move all helper code to module