simplify and misc polishing