Added suport for duration types.
_
Refactoring.