Sending the hash as a parameter for now. Not ideal, but will refactor at a future date.