Refactored to provide a cleaner, more semantic API