improve favorite logic