improved the fetch logic for get class