Working on linking database and in memory classes