Refactored Create Divs code for clarity.