Logic moved in a helper class
Added PHPUnit for testing pourposes