GDS-1063 Changed implementation of existing component detection
Use the newly added managedInstances map instead of looping on the
contexts