Would it be possible to break this block into smaller methods?