refactor div code