First work on optimizing code