Refactor build and packaging

why removing the pretest?