Refactored the code and removed the hard-coded port number to allow it to be provided externally