I think this level of code duplication is ok for debugging purposes