better way to do immutability