Moves a function to the shared state object