refact ip v4/v6 support