refactored version queries to a separate class