Factorize preview hiding