Clean net function