refactored to using the duration map hash instead of a long list of case statments