refactor how show action is handled