[She] took trouble to learn her lines and repeated the scene until it was perfect. That way, she could forget the "immodesty" of what she was doing.
The passage is talking about a porn star. I am confused about the last sentence. Does it mean that "That way, she could forget the 'immodesty' and forget of what she was doing" ?