various tweaks and cleanup