Extracting utilities into more testable methods