Refactor/legends extra html