Avoid pushing/popping stack when possible