DB-update + moved some code in mem model