fix up test cases and dependencies
remove redundant code