Refactored code. Corrected HTML semantics