Refactoring into submethods