little reorganization in register, various cleanup