Betterise code snippet