extracted code from billy-data