link and build cmd refactor