Some code cleanup in net