split out into 2 functions, longer and compact fragment