fixes duplicate helper code