Bettering tb code a little