simplify & clean up construction of markdown content