restructured to make it usable with getcomposer