insert better documentation

insert better documentation and optimize redudant classes