small tweaks for performance and cleanup