Refactor bcfg2 invoking