first round of changes into host.c