Add functions to models