Refactored index code, and created example module