moving b2g logic into the helper away from fireplay