rename the type to key to keep the DB paradigm