Mid way through refactoring using a properly attributed object rather than Global variables