this should probably be flowed through as a 2nd arg to this.replaceState, another function accessible by client code and where the ultimate work of generalizing this will go.