Card code for Database layer