remove some redundant lines of code