Change table keys parameter from type -> key to key -> type