splitting main into main/test
niceing code