be2net: refactor be_get_resources() code