Refactored code into a package + main