refactored versiondao to separate revision id calculating logic from the query executor