refactor form and index templates for Bootstrap 3