command/build: adjust sequence of code