Fixing code to PSR2 and adding joinWithType method