Safer way to handle variables from Scan