refactoring of date parameter handling