Rewrite more efficient