refactor of show method