some simple refactorization