simplified writer implementation