index takes hats from databases. Ugly code. clean up of some templates.