reorder things to make better use of caching, expose correct port