reorganize testing codes