Answer
The answer is updated criminal code. Charles XV played a crucial role in modernizing Sweden's legal system by instituting the Criminal Code of 1864. This code replaced the outdated 1734 code and introduced significant reforms, including removing the death penalty for non-violent crimes, establishing prison sentences as the primary form of punishment, and ensuring the independence of judges.