Refactor and redesign domains

Referring the Quora: "Know your libraries and frameworks, and use them instead of writing your own implementations. Especially, don't try to write your own date and time routines!"