making method more composed

breaking up the large method into many smaller ones makes it easier to
understand