Improve port handling

Improved port handling, adding an ability to update an existing port and reusing the port entity for all operations.