Small refactoring to simplify