some optimization from scalability tests