refactor to allow for multiple log calls