Refactoring to separate modules.