refactoring the code. Replacing the @variables by let(:method) { }