Rehauled div id generation code