Add doctype
Refactor codes