Expand functions to avoid recusive limit of 500