Trim instead of preg_replace
No sence to set . as default && check if string is empty
Merge pull request #7 from an1zhegorodov/master

Merging some refactoring