refractor test.cpp