Improve way to get attr name