Revert 569bbb3..512199d

This rolls back to commit 569bbb37c06087a86fdc925617ca885b71effd31.
refactor test codes