I am having a hard time porting this to D7 manually. Is there an alternative method that may/may not be partially built into D7's core capabilities?