refactoring of test.sml
merge