Dev to Master

refactor the codes.