Refactor models and node_api

Another long line and up there at line 18 too.