-Refactored out a function