Using chaining to reduce code