Refactor index to move app into a separate module