add js: js single responsibility principle