Visibility script improvements