It's not necessarily a bad thing to try to move code out of a form. Ideally, forms should deal with presentation and nothing else, so likely this background task actually does belong outside. That said, what you would normally do is define a class that was responsible for this task. You would create an instance and then tell it to do its job. That instance could then raise an event to indicate a change in progress and your form would handle that event and then update the UI accordingly. As you can see, the form handles the presentation aspect without doing the actual work. You could still use an event with a module if you wanted to.