Introduced some optimization