Add unsubscribe and did some refactoring for better expandability