DSA - Linear Data Structures - Refactoring