Moved host prep function.