Refactoring Code