Apply extract method pattern