As long as you keep mixing "business logic" in with your "data access" logic, your life will continue to be difficult. You are simply copying and pasting each "case", without any thought to the amount of duplicate code you are creating. I would tell you to rewrite what you've got instead of helping you to "fix" it (and continuing to support your bad habits). Or are you getting paid by lines-of-code?