Refactored Driver Script. Seperated functionalities in to different packages