moved external model functions to root.