fixed gem and factory conflict issues