refactoring (reek) avoiding multiple calls by using array of items. removed nil call