Refactor the following Python function to use list comprehensions.
def square_numbers(nums):
  result = []
  for num in nums:
    result.append(num ** 2)
  return result
def square_numbers(nums):
  return [num ** 2 for num in nums]