selecting based on type