Add function to patterns helper