Refactored hasRows and implemented record cound class.