refactor index page with erb