network module code cleanup