small refactoring of build module