updated example to have a shared factory getting and posting data