can optimize get_slots
deepcopy is slow