Refactoring of ApplyController