Move t? function and refactor for rspec.