Rearrange architecture to set index when app inits

Fixes #24