Fixes and refactoring
Merge pull request #3 from apploft/Update

Fixes and refactoring