remove some extraneous stack operations