Integrate comments from RI, rearrange some things