refactored layer. refactored netmanager.