First refactoring work.