Extends classes to include the to_b method