Fix function name
Remove duplicated code
Remove redundant templates
Include the index in the RTD sidebar