remove unused variables and functions in sprite