bugfix
minor refactoring