moved minutes indexing logic to model