Refactoring the observer still trying to make it more testable.