Code refactorin