remove unused variables and simplify test to not cause unused variable warning