minor cleanup around simplify and derivative code