add some common helper functions