Stop passing the state to functions that don't need it