test: use instance variables instead of local variables