refactored program controller and associated models