change output implementation to not call console.log