Move variables out of global scope