refactoring.

Change-Id: Iaa747b6576ffba9e38f2d8b5bc6ad9f56d050275
Reviewed-on: http://review.couchbase.org/37382
Reviewed-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>