Extract duplicate code to single method.
Reduce scope of methods.