Made code optimization