code refactorization