Updating a bit to modern code