More refactoring into methods.