internet permission + minor refactor