Attempt to restructure code using static vars and methods