Implemented key factory.