ENH: improvements after Julien's code review