Some more refactorization