exceptions handling, code cleanup, setup corrections