diff --git a/doc/MQTT_V3.1_Protocol_Specific.pdf b/doc/MQTT_V3.1_Protocol_Specific.pdf
deleted file mode 100644
index 2ea1b2cab..000000000
Binary files a/doc/MQTT_V3.1_Protocol_Specific.pdf and /dev/null differ
diff --git a/doc/design/ClientSession.md b/doc/design/ClientSession.md
deleted file mode 100644
index c7f6f53d2..000000000
--- a/doc/design/ClientSession.md
+++ /dev/null
@@ -1,55 +0,0 @@
-## Transient Client/Session Sequence1
-
-```
-Client1->SM: {start_session, {true, ClientId, self()}}
-SM-->Session: {destory, ClientId}
-Session-->Session: {shutdown, destroy}
-Session-->Client2: exit({shutdown, destroy})
-Client2-->CM: {'DOWN', MRef, process, Pid, Reason}
-SM-->Client1: {ok, SessPid}
-Client1-->CM: {register, Client1}
-```
-
-
-
-## Transient Client/Session Sequence2
-
-
-```
-Client1->SM: {start_session, {true, ClientId, self()}}
-SM-->Session: {destory, ClientId}
-Session-->Session: {shutdown, destroy}
-SM-->Client1: {ok, SessPid}
-Client1-->CM: {register, Client1}
-Session-->Client2: exit({shutdown, destroy})
-Client2-->CM: {'DOWN', MRef, process, Pid, Reason}
-```
-
-
-
-## Persistent Client/Session Sequence1
-
-```
-Client1->SM: {start_session, {true, ClientId, self()}}
-SM-->Session: {resume, ClientId, ClientPid}
-Session-->Client2: {shutdown, conflict, {ClientId, Pid}}
-Client2-->CM: {unregister, ClientId, self()}
-SM-->Client1: {ok, SessPid}
-Client1-->CM: {register, Client1}
-```
-
-
-
-
-## Persistent Client/Session Sequence2
-
-```
-Client1->SM: {start_session, {true, ClientId, self()}}
-SM-->Session: {resume, ClientId, ClientPid}
-SM-->Client1: {ok, SessPid}
-Client1-->CM: {register, Client1}
-Session-->Client2: {shutdown, conflict, {ClientId, Pid}}
-Client2-->CM: {unregister, ClientId, self()}
-```
-
-
diff --git a/doc/design/Design_Cluster.graphml b/doc/design/Design_Cluster.graphml
deleted file mode 100644
index 0e1e06791..000000000
--- a/doc/design/Design_Cluster.graphml
+++ /dev/null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
-
-
-
- P
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- P
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- S
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- S
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/doc/design/Design_Standalone.graphml b/doc/design/Design_Standalone.graphml
deleted file mode 100644
index 9382a66f6..000000000
--- a/doc/design/Design_Standalone.graphml
+++ /dev/null
@@ -1,274 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- P
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- P
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- S
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- S
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- +
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- x
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- y
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- t
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/doc/design/Seq.graphml b/doc/design/Seq.graphml
deleted file mode 100644
index 8ddc9353a..000000000
--- a/doc/design/Seq.graphml
+++ /dev/null
@@ -1,234 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- T
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- C1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- S1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- C2
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- S2
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Queue
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Queue
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Dispatch
-
-
-
-
-
-
-
-
-
-
-
-
- Deliver
-
-
-
-
-
-
-
-
-
-
-
-
- Publish QoS1/2
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Publish Qos0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/doc/design/Seq.md b/doc/design/Seq.md
deleted file mode 100644
index 924de84d3..000000000
--- a/doc/design/Seq.md
+++ /dev/null
@@ -1,14 +0,0 @@
-## QoS0 Publish Sequence
-
-
-```
-title QoS0 Publish Sequence
-
-C1->PubSub: Publish QoS0
-PubSub-->S2: Dispatch QoS0
-S2-->C2: Deliver QoS0
-```
-
-## QoS1 Publish Sequence
-
-
diff --git a/doc/emqttd.graphml b/doc/emqttd.graphml
deleted file mode 100644
index 0add31baf..000000000
--- a/doc/emqttd.graphml
+++ /dev/null
@@ -1,993 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- emqttd broker cluster
-
-
-
-
-
-
-
-
-
- Folder 1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- +
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- x
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- y
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- t
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- +
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- x
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- y
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- t
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- +
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- x
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- y
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- t
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
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
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- MQTT
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- WebSocket
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- WebSocket
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- MQTT
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- MQTT
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- MQTT
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/doc/emqttd.png b/doc/emqttd.png
deleted file mode 100644
index 6066d5d08..000000000
Binary files a/doc/emqttd.png and /dev/null differ
diff --git a/doc/mqtt-v3.1.1-os.pdf b/doc/mqtt-v3.1.1-os.pdf
deleted file mode 100644
index 03a935fdd..000000000
Binary files a/doc/mqtt-v3.1.1-os.pdf and /dev/null differ
diff --git a/doc/pool.md b/doc/pool.md
deleted file mode 100644
index 1f032fd55..000000000
--- a/doc/pool.md
+++ /dev/null
@@ -1,7 +0,0 @@
-sup(one_for_all)
- manager
- pool_sup(one_for_one)
- worker1
- worker2
- ...
- workerN
diff --git a/doc/rfc6455.pdf b/doc/rfc6455.pdf
deleted file mode 100644
index 74625160e..000000000
Binary files a/doc/rfc6455.pdf and /dev/null differ
diff --git a/doc/uuid.md b/doc/uuid.md
deleted file mode 100644
index 5b7bd0aa0..000000000
--- a/doc/uuid.md
+++ /dev/null
@@ -1,19 +0,0 @@
-## Mongodb ObjectId
-
-* 4-byte value representing the seconds since the Unix epoch,
-* 3-byte machine identifier,
-* 2-byte process id, and
-* 3-byte counter, starting with a random value.
-
-## Flake Id
-
-* 64bits Timestamp
-* 48bits WorkerId
-* 16bits Sequence
-
-## emqttd Id
-
-* 64bits Timestamp: erlang:now(), erlang:system_time
-* 48bits (node+pid): Node + Pid -> Integer
-* 16bits Sequence: PktId
-
diff --git a/doc/design/Architecture.png b/docs/source/_images/Architecture.png
similarity index 100%
rename from doc/design/Architecture.png
rename to docs/source/_images/Architecture.png
diff --git a/doc/design/Design_Cluster.png b/docs/source/_images/Design_Cluster.png
similarity index 100%
rename from doc/design/Design_Cluster.png
rename to docs/source/_images/Design_Cluster.png
diff --git a/doc/design/Design_Standalone.png b/docs/source/_images/Design_Standalone.png
similarity index 100%
rename from doc/design/Design_Standalone.png
rename to docs/source/_images/Design_Standalone.png
diff --git a/doc/design/PersistentSessionSeq1.png b/docs/source/_images/PersistentSessionSeq1.png
similarity index 100%
rename from doc/design/PersistentSessionSeq1.png
rename to docs/source/_images/PersistentSessionSeq1.png
diff --git a/doc/design/PersistentSessionSeq2.png b/docs/source/_images/PersistentSessionSeq2.png
similarity index 100%
rename from doc/design/PersistentSessionSeq2.png
rename to docs/source/_images/PersistentSessionSeq2.png
diff --git a/doc/design/PubSub_CleanSess_0.png b/docs/source/_images/PubSub_CleanSess_0.png
similarity index 100%
rename from doc/design/PubSub_CleanSess_0.png
rename to docs/source/_images/PubSub_CleanSess_0.png
diff --git a/doc/design/PubSub_CleanSess_1.png b/docs/source/_images/PubSub_CleanSess_1.png
similarity index 100%
rename from doc/design/PubSub_CleanSess_1.png
rename to docs/source/_images/PubSub_CleanSess_1.png
diff --git a/doc/design/Seq.png b/docs/source/_images/Seq.png
similarity index 100%
rename from doc/design/Seq.png
rename to docs/source/_images/Seq.png
diff --git a/doc/design/TransientSessionSeq1.png b/docs/source/_images/TransientSessionSeq1.png
similarity index 100%
rename from doc/design/TransientSessionSeq1.png
rename to docs/source/_images/TransientSessionSeq1.png
diff --git a/doc/design/TransientSessionSeq2.png b/docs/source/_images/TransientSessionSeq2.png
similarity index 100%
rename from doc/design/TransientSessionSeq2.png
rename to docs/source/_images/TransientSessionSeq2.png
diff --git a/doc/design/qos0_seq.png b/docs/source/_images/qos0_seq.png
similarity index 100%
rename from doc/design/qos0_seq.png
rename to docs/source/_images/qos0_seq.png