auto-detecting type; starting on function and primitive validation