add some optimization