Code refactorize