replace @buttonstate with accessor