Refactored time tests and some time functionality