Added parameter state as separate object to better deal with child scopes