Refactored to work in asynchronous way
Small refactoring for specs
Added OS X support