continuing to re-factor code to be more testable