Any ideas for encoder mounting?

I was thinking of coming off the end of the motor shaft - there is an M10 threaded hole in it, then connecting the encoder to the shaft. I'm not sure if a rigid connection is a good idea though, is a coupling of some sort better here??

The other option is a 36t HTD5 pulley bored out to 35mm to fit the spindle shaft and mount this between the spindle drive pulley and the old lower vari-disk/brake disk in the head then mount the encoder out the front where the old speed control used to live using another 36t pulley. Not as cosmetic as the motor shaft idea but??

Any thoughts?