Slightly more refactoring