[api] refactor HasAttributes a bit