Finish refactoring main components.