Fixed author email key in composer.json
Replaced redundant code by helper function