Begin Refactor Extract Function