mostly working client-side