Almost done with rewriting the queries, string to time conversion is now done at the helper.