[markdown] code refactor