A simple API for factories.