Refactorings

This change will require a major version bump as it has changed the signatures of public methods.