some smaller refactorings