#142 - Moved code into it's own function.