Split generator code into client & server files