move some methods to ProgramModel from ProgramController