fixes and simplification