Refactor class tests