more slight refactoring