refactor and add more comments
Release 2.2.1