Reworked preferences reference a bit. Still not working, so left unused at the moment
Missed changes in last commit