split up cli logic