Refactor main template
Create tab for AFP