Removed todo.
Refactoring and make clang static analyzer more happy.