refactored element data into Element class