refactored context to method level parameters