separate main and move misc files