Adding helper functions.