moved code into a class & updated composer.json & readme