refactor methods into extractor