Refact. Add ip support.