JBs tools and helper functions.