remove unused code
fix upgrade and decline