Refactor

Odds and ends got refactored.  Still needs for me to read more on the
logic to better refactor, though.