replace 'if' to 'return' and remove next line