Gui & Net code rewrite