restructuring and docblocks
some changes