Improve jQuery for tab selection