div element setting code refactoring