[UPDATE] Some performance issue and code style.