Re-implemented the NetworkManager singleton to use a reference instead of pointer