Improve the show and hide method.