UP-3626 Complete consolidation of impersonation logic