Refactor instance service.