extracted main()`s