M5/master refactor tests

test refactor and fixed some bugs in times