Deleted old Package and Refined codes

-Introduced Switch statement for clarity
-Extracted method that contains main logic