cleaner use of global var(s)