Changed the public functions in model to be protected, and static instead