refacotr local and renewRanking