refactor remove the unneccessary variable