move prompt logic from directive to factory