Refactoring client side code for best practise. Added a translation service