Make before_build functionally equivalent to the old version