just a little code refactorization