Broken a complex method down into smaller chunks.