Code refactorting