#508: remove duplicate code, change expanding data