Trying to convert getInterval into method template