refactored as method invocation