Refactored code .