move shared methods into module