Further refactoring to loose coupling.