reorg code structure + 1st Test
Testing of main logic