snippet helper functions