minor refractoring in bugle