performance improvment and more output messages