Added base name printing logic
Moved index to template