minor code reordering in the cake