extract net/ into separate library