More tweaking and cleanup