Refactor to introduce (maybe even too much) structure in .tex files