expectDeprecation, and a refactor