moved intent code