Lazy connection

This has two commits 

1. Lazy connection .
2. Coding style fix for PSR-2 .

Let me know what you think.

Thanks