client-side code cleanup