reduce the use of return and next statements
reduce use of self