Added convenience method and slight refactoring.