Refactored common routines

Created class object that will handle the common routines used within
the project to avoid duplicated code.