type safeness and legacy keys