NodeJS -> model refactor