Make code more Swift-style