remove unused code and add shared preference utils