minor changes/fixes and reorderings