Remove useles return statement and tidy code