Removed unecessary intermediate function.