separate main from geometry