Work on documents, separated UI from Main