minor js code cleanup