some uitility functions for bt