core: rearrange queue when remove element
core: respect visibility
Refine