slight refactor to applications controller