optimized sharedpref utils