factorize views