refine left menu code