refactor show hide