factor out Application logic from ApplyController