Refactored extracting time and phrase