remove unnecessary in-place-ness and some other extraneous code