Moving generic fn to top of file.