client-side code