Issue #13 refactor all global variables to become instance variables