moved variable writer to separate package