Code refactorig