move new function into plan module