Revised API to allow for logging