It often helps to split things up into smaller methods.

Is the ``$managerId`` below necessary? Why not check for the registry directly?