Document and remove unnecessary code.