bit more cleaning/factorization