Better sync and category assignment

#26