Refactoring presence into a service