Remove 'after_build' and simplify code.