Fix comments, refactor for clarity