separate port and host config in template