add some comments
remove unused class
refactorings to make code simpler

use more convenient helpers