add comments & small refactor
small refactor