code refactor, move SharedPreference related code out of Application