Refactoring CheckpointQuery.java