Refactored factory and component system.