JS - Merged activities; using global structures