Remove unneeded check for empty array from categorize().
Put categorize() atom code inside else to make structure clearer.