Refactor the app index template