Fixing some more perf and style issue