refactor datetime_filter to be more abstract and taking less responsibilities.
pull up common statement builders.
add belongs_to_association handler to active_record.