handles %i identifier and optimises code