Adding tests in anticipation of refactoring