refactor cat