Remove unused variable and unchecked