trying to follow the Apple swift style samples more closely