refactoring and reordering the appendix template