CS (PSR-2) and minor fixes
add docblocks and minor fixes