Updating Network class to be more robust