binman: Move selection of the binman node into a function