converted if into return statement

because I want to inline that method