Done some optimization