Moved variables out of a static method