Refined main