Cleanup code, tweak minor layouts