Superfluos compiler pass

As far as I can see the `Extension`-class set up the container properly and then the compiler pass removes the definition again, if they aren't required. Isn't this a little bit superfluos? Why not simply skip registering the services, when we know, that they aren't required?