Updated some core functions. Added  to the AppModel