Clean up available/connected logic via macro