factory using the provide object