Removing unnecessary else and return statements