updating documentation for CPAN, minor refactorings