add getType and getState methods