did some optimization