refactoring

Refactoring Network class