Improve legend