Decrease the use of generate-id(): phase 1

Instead use ahf:generateId() as far as possible.