organize templates/index.ls functions