Refactored code!