refactoring with with? method