some refactoring.
attempt to simplify


git-svn-id: https://ilk.uvt.nl/svn/trunk/sources/Mbt3@17364 12f355fe-0486-481a-ad91-c297ab22b4e3