minor nit: no need for the if (!empty) condition here