minor fixes, code cleanup, doctest does not work anymore