Single function 'setElements({})' to handle state changes