factorize styles