clean code and add basic format parser