Refactored node type selection