This question already has an answer here:
I am a student and a freelance programmer. These days I am developing a software in VB6 which has recently crossed 100KB of source code.
The main problem, I face is, many times I have to refactor my existing source code which is really very boring. Also the size of my code base is not very big (only 100KB).
What are the techniques I should you use to prevent my code from getting mess?