fixes and simplifications