add source source

Signed-off-by: Wang Zhen <lazybetrayer@gmail.com>
some refactor

Signed-off-by: Wang Zhen <lazybetrayer@gmail.com>
make it more encoding/json like

Signed-off-by: Wang Zhen <lazybetrayer@gmail.com>