Further refactoring for loose coupling