code simplifying
minor refactoring. documatation adjusted.