Indexed scripts/templates cleanup

Changes after review comments.