split out flex/security context