move preview creation work to a service