Refactor models and node_api