refactored appendix