Minor DRY refactoring