refactoring etxjs