port and host are backwards
changed template to allow more flexible choice of engines