refactor if condition: to use guard clause instead of wraping code block in if conditione