implemented internal state as object