Refactored element creation code; replaced css values with javascript constants