improve text&attr compile
simplify getter to reduce get events triggered