refacorted method for searching by time created