1) Refactored Code