Moving some lines out of ax optimization