separate the return from if-block