refactoring: extracting method