Refactored code...