Refactoring with more flat structure.