remove scan hash and unused variable