use conditional and remove redundant "return"