Extract functionality to marked-sections package