Categorical aspects of modularity