Refactored some more including the background manager