Clean up widget factory logic