Break apart and refactor tests