Refactor ordination results writer

Less duplication of code and literals, better decomposed.