Add test, remove some local variables