refactor socketform stuff