Refactoring MainActivity and Service communication.