Refactor "with" operator