Imroved code structure