refactor getRevision method