Revert "slightly improve the performance"

This reverts commit df3fb2fcce021dd851581e59fa276943b21c8974.

Not an improvement.
Revert "change code for readability without any performance improvement"

This reverts commit cb9035a947760e37fd330d0095cbc79efa48cbbf.

Actually hurts performance