clean preferences read/write/create functions