Refactoring for modularity.