Factorise by grouping (#265)