Don't return nil when trying to install an already installed component, return the installed component instead. Also, use each_with_object instead of reduce where appropiate.