moved some responsibilities around and refactored tests