Refactored finding reference date index
Merge branch 'hideki1'