Fix time format & refactor decode/encode to separated files.