Refactoring, introducing subroutines