Create factory with saveActivity function