refactor of package setup and test framework