refactor lua test cases