Practice writing good clean code and even do some practice refactoring exercises. That is great.<p>Do not, <i>absolutely do not do</i> un-needed refactoring in the context of a bug fix (or feature request). I would fail a code review that did this and I would dismiss a job candidate that told me the actively look for opportunities to do refactoring like this. If your bug fix results in a new bug there is no telling what you did or why.<p>If you want to do a refactoring, propose it as a sprint unrelated to a bug fix. That way your bugs get fixes that are just fixes, your new features are just features and your refactoring is just cleanup. All properly prioritized. Get any of them wrong and you can understand what was the justification and how to potentially fix things or back them out.<p>Repeatedly muddle them all together and I would fire you.