Refactor build, generate, benchmark modules