better implementation of defaultValue support