some more refactorign using TypeFamilies
updated documentation