Fixed UTF-8 conversion when calling str(element)
Starting to refactor frontend code to allow better protoypal inheritanhe
adopted styling
simplified the code