Sometimes you can spend hours working on a piece of code as you refactor it toward a more logical organization (and persistence is certainly one of the key traits to being a successful software developer). If you find that you are getting increasingly frustrated however as you unearth the ever expanding treasure of technical debt, then step away from the keyboard and go out for a walk.
Frustration is the development environment's way to tell you that you need to approach this differently. Maybe start off with a clean slate, a new class, maybe even a standalone project, and then add the functionality you were tying to cull from elsewhere. Be persistent, but avoid swimming up to your neck in the marsh trying to fight the alligators. Start a new marsh instead.