Review and update source code

bit tired =~=