add memory implementation for factories