[OE-4547] Remove code duplication from generic admin.