Added a callback fn to prefObserve; Misc changes in helpers and utils