Refactor trip count