Light refactoring + comments for PORT command