cleaning-up-messy-chaining-code-in-swift