Some refactor.

Summary: