replace block with method