Clean dead code and add comments.