performance improve

Do these things

* use `auto&` instead of `auto` if possible
* correct some coding style
* initialize an object in constructor to remove unneeded assign operation
* remove unneeded temple object
i think here is not elegant enough, but I do not know how to improve.
maybe we need to keep a 3d position, and keep.