Refactor of the calculateDelimterMethod