Various refactoring.
Various refactoring.