tidy up port def