various refactors
update documentation