more refactorization