Move fn declaration outside of reducer.