decompose index generation
further decompose index generation
some sugar
some ramda magic