minor refactoring
added flag to track preference changes by user