Defining state type and reducers.