improve logic for mod category management