* move logic to internal and make main declared