Clean up redundant dependencies
Little tweak on sorting (reducing document-redraw)