refactor code + fix internationalization