port number can be passed as a cli argument, minor cleanups