Refactor tests and time pattern constant