[bad] refacotring out main, tests, app