Refactoring so that the application communicates better between components