Optimize PromiseController + code style cleanup.