Js model refactor