refactored test program