Some refactoring (allow different hosts for appservices