better config and ports handling