modularize post templates a little bit; try to unify duplicate code