Make service instance tasks more generic. Torwards a generic lifecycle state machine