further refactor utilising .each