Refactor code to avoid duplication
minor
Merge branch 'New3' of github.com:ayende/ravendb into New3