Implemented a factory to use  methods