build some basic utility functions