Layout factorization