Move Node model to database layer