Many tweaks and clean ups