move class local variables into methods