Refactor
Last round of changes before passing off to Greg Rewis