Update code to newest Swift syntax