Remove useless code
Add some inline doc, rm/fix some comments