[PATCH v3 05/10] Move self-isolation code into a separate file