Refactored some code and remove some observables.