refactored Program controller