refactory
make test runnable