refactored with tape tests