Refactored Code (Me & Saurabh M Pairing)