Refactoring html graphic