performance optimization; code style