refactor based on passing date string.