js/bbks: push flexibility into caller