Helper function for generating Div