Refactor the code according to the new database. New model methods.