refactoring longcat