Alternative solution without guard clauses