clean-up code, remove unused variables, add onDestroy()