Extract a method.

About to generalise it into two methods.