Clean code and add more tests for DateTime