simplifications and fixes