Refactor and make service embeddable