Refactor remove unused variable