use the more idomiatic if-let