Many tweaks and clean up